from Sprites import *
def gen_monster():
     monsters = []
     for _ in range(20):
            for i in range(len(MapSettings.matrix)):
                for j in range(len(MapSettings.matrix[i])):
                    if MapSettings.matrix[i][j] == 2:
                        if MapSettings.Room_1['x1']<j<MapSettings.Room_1['x2'] and MapSettings.Room_1['y1']<i<MapSettings.Room_1['y2']:
                            flag = random.randint(0, 750)
                            if flag ==8:
                                monsters.append(spirit(j*40,i*40,40,40))
                                MapSettings.matrix[i][j] = 3
                        if MapSettings.Room_2['x1']<j<MapSettings.Room_2['x2'] and MapSettings.Room_2['y1']<i<MapSettings.Room_2['y2']:
                            flag = random.randint(0, 750)
                            if flag ==8:
                                monsters.append(spirit(j*40,i*40,40,40))
                                MapSettings.matrix[i][j] = 3
     return monsters                           
                 